﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Entetities;

namespace DAL
{
    public class KhachHangDAL
    {
        private DataHelper dh;
        public KhachHangDAL()
        {
            dh = new DataHelper();
        }
        public int InsertKhachHang(KhachHang kh)
        {
            try
            {
                SqlParameter p1 = new SqlParameter("@KhachhangId", kh.KhachhangId);
                SqlParameter p2 = new SqlParameter("@HoKhachhang", kh.HoKhachhang);
                SqlParameter p3 = new SqlParameter("@Tenlotkhachhang", kh.Tenlotkhachhang);
                SqlParameter p4 = new SqlParameter("@Tenkhachhang", kh.Tenkhachhang);
                SqlParameter p5 = new SqlParameter("@Tencongty", kh.Tencongty);
                SqlParameter p6 = new SqlParameter("@Ngaysinh", kh.Ngaysinh);
                SqlParameter p7 = new SqlParameter("@Diachiemail", kh.Diachiemail);
                SqlParameter p8 = new SqlParameter("@Sodienthoai", kh.Sodienthoai);
                SqlParameter p9 = new SqlParameter("@Diemthuong", kh.Diemthuong);
                return dh.ExecuteSP("add_khachhang", p1, p2, p3, p4, p5, p6, p7, p8, p9);
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
